package com.cn.removewatermark.utils;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public class FileUtils {

    private FileUtils() {}

    public static Integer getFileSize(String url){
        HttpURLConnection urlConnection = null;
        try {
            urlConnection = (HttpURLConnection)new URL(url).openConnection();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            if (urlConnection!=null) {
                urlConnection.disconnect();
            }
        }
        return urlConnection.getContentLength();
    }

}
